/**
 * 广告主api
 */
angular.module('imsApp').factory('FocusManager', ['$http','api', 'paramsManager', function ($http,api, paramsManager) {
    var FocusManager = {
        /**
         * 获取关注的设备的Id的列表
         params:[pageNo,pageSize]//顺序不能错
         query{}
         */
        cuidList: function (params, query) {
            return $http.get(api+"/ims/focusCuids/" + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 获取关注的ip的列表
         params:[pageNo,pageSize]//顺序不能错
         query{}
         */
        ipList: function (params, query) {
            return $http.get(api+"/ims/focusIps/" + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 添加设备到关注列表
         */
        cuidAdd: function (params) {
            return $http.post(api+"/ims/focusCuids", params).then(function (result) {
                return result;
            });
        },
        /**
         * 添加ip到关注列表
         */
        ipAdd: function (params) {
            return $http.post(api+"/ims/focusIps", params).then(function (result) {
                return result;
            });
        },
        /**
         * 取消关注的设备id
         */
        cuIdUnFocus: function (ids) {
            return $http.delete(api+"/ims/focusCuids/" + ids.join(",")).then(function (result) {
                return result;
            });
        },
        /**
         * 取消关注的Ip
         */
        ipUnFocus: function (ids) {
            return $http.delete(api+"/ims/focusIps/" + ids.join(",")).then(function (result) {
                return result;
            });
        }


    }


    return FocusManager;
}]);
